package org.elte.lipika.client.managed.ui;

import com.google.gwt.requestfactory.ui.client.ProxyRenderer;
import org.elte.lipika.client.managed.request.OriginalProxy;

public class OriginalProxyRenderer extends ProxyRenderer<OriginalProxy> {

    private static org.elte.lipika.client.managed.ui.OriginalProxyRenderer INSTANCE;

    protected OriginalProxyRenderer() {
        super(new String[] { "id" });
    }

    public static org.elte.lipika.client.managed.ui.OriginalProxyRenderer instance() {
        if (INSTANCE == null) {
            INSTANCE = new OriginalProxyRenderer();
        }
        return INSTANCE;
    }

    public String render(OriginalProxy object) {
        if (object == null) {
            return "";
        }
        return object.getOriginalText() + " (" + object.getId() + ")";
    }
}
